<template>
  <div>
    <span type="text" @click="dialogFormVisible = true">编辑</span>

    <el-dialog title="编辑" :visible.sync="dialogFormVisible">
      <el-form ref="" :model="form" label-width="90px" 
      >

<el-row>
  <el-col :span="10" >
    <el-form-item label="员工编码：" >
          <el-input v-model="form.code" placeholder="请输入内容"  :model="form" ></el-input>
    </el-form-item>
  </el-col> 
  <el-col :span="10">
  <el-form-item label="用户名：">
          <el-input v-model="form.nickname" placeholder="请输入内容"></el-input>
  </el-form-item>
  </el-col>
</el-row>


<el-row>
  <el-col :span="10" >
    <el-form-item label="角色名称：">
      <el-select v-model="form.roleId" placeholder="请选择活动区域">
        <el-option label="销售组" value="1"></el-option>
        <el-option label="仓管组" value="2"></el-option>
        <el-option label="出库组" value="3"></el-option>
      </el-select>
    </el-form-item>
  </el-col> 
  <el-col :span="10">
  <el-form-item label="员工姓名：">
          <el-input v-model="form.name" placeholder="请输入内容"></el-input>
  </el-form-item>
  </el-col>
</el-row>

<el-row>
  <el-col :span="10" >
    <el-form-item label="所属分店：">
      <el-select v-model="form.subbranchId" placeholder="请选择活动区域">
        <el-option label="望京分店" value="1"></el-option>
        <el-option label="王府井分店" value="2"></el-option>
      </el-select>
    </el-form-item>
  </el-col> 
  <el-col :span="10">
  <el-form-item label="员工电话：">
          <el-input v-model="form.phone" placeholder="请输入内容"></el-input>
  </el-form-item>
  </el-col>
</el-row>

<el-form-item label="身份证号">
    <el-input v-model="form.idcode"></el-input>
  </el-form-item>

  <el-row>
  <el-col :span="10" >
      <el-form-item label="在职状态">
      <el-radio-group v-model="form.status">
        <el-radio label="true">在职</el-radio>
        <el-radio label="false" >离职</el-radio>
      </el-radio-group>
    </el-form-item>
  </el-col> 
  <el-col :span="10" >
    <el-form-item label="所属分组：">
      <el-select v-model="form.groupId" placeholder="请选择活动区域">
        <el-option label="A组" value="1"></el-option>
        <el-option label="B组" value="2"></el-option>
      </el-select>
    </el-form-item>
  </el-col> 
</el-row>
  

</el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false;queren()">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<style lang="less" scoped>

  </style>

<script>
import {staffeditorPost}from '../../http/api';
export default {
  props:['form'],
  data() {
    return {
      dialogFormVisible: false,
   
      
    }
  },

   methods: {
      onSubmit() {
        console.log('submit!');
      },
      // 确定提交的按钮
      queren(){
        // 编辑接口在这里调用
        console.log(this.form,"ppp",this.list)
      staffeditorPost(this.form)
        .then((res)=>{
          console.log('接口调用成功',res.data.value.data)
          // this.$parent.getlist()
          
        })
        .catch((err)=>{
          console.log('接口调用失败',err)
        })
      }
      }

}
</script>